CC = g++

SRC_DIR = ./src

OBJ_DIR = ./obj

HEAD = -I./src

CFLAGS = -Wall -lfftw3 -lm

SOURCE := \
main.cpp \
dataset.cpp \
dpalgo.cpp \
algo.cpp \
bruteforce.cpp \

OBJS := $(addprefix $(OBJ_DIR)/, \
		$(patsubst %.cpp, %.o, $(SOURCE)))

BIN = ./bin

$(BIN): $(OBJS)
	$(CC) $^ -o $@ $(HEAD) $(CFLAGS)

$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
	mkdir -p obj
	$(CC) -c $^ -o $@ $(HEAD) $(CFLAGS)

.PHONY: clean run

clean:
	rm ./obj/*.o ./bin

run: $(BIN)
	./$^
